﻿@using XStudio.WebFramework.Mvc.Extensions
<script type="text/javascript">
    var AddressList = {};

    //删除按钮触发事件
    AddressList.Delete = function (e) {
        if (!confirm("确认要删除吗？"))
            return;
        $.post($(e).attr("href"), function (data) {
            if (data.IsOK) {
                $('#tbAddressList').datagrid('reload');
            }
            else
                alert(data.Description);
        });
    }

    //是否执行ready函数标记
    AddressList.Binded = false;

    $(document).ready(function () {
        if (AddressList.Binded) return;
        AddressList.Binded = true;
        //按钮搜索事件
        $("#btnIMEIInfoSearch").unbind("click");
        $("#btnIMEIInfoSearch").click(function () {
            $("#tbAddressList").datagrid({ pageNumber: 1, queryParams: { SearchWord: $("#txtIMEIInfoSearchWord").val() } });
        });
        //呈现列表数据
        $("#tbAddressList").datagrid({ pagination: true });
    });

</script>
<div class="tt-attach">
    <ul class="op">
        <li>
            <input class="search-text" id="txtIMEIInfoSearchWord" style="width: 150px;" type="text" placeholder="请输入IMEI进行搜索" title="请输入IMEI进行搜索" value="" /><input id="btnIMEIInfoSearch" class="search-button" value="搜索" type="button" />
        </li>
    </ul>
</div>
<div style="padding: 5px 10px;">
    <table id="tbAddressList" style="height:auto" stridep="true" rownumbers="true" fitColumns="true" title="" iconcls="icon-edit" fix="true"
           idfield="UID" pagesize="30" url="@Url.Action("AddressListData",new { id=ViewBag.ID})">
        <thead>
            <tr>
                <th field="UID" checkbox="true" width="150">
                </th>
                <th field="Address" width="80" align="center">
                    地址
                </th>
                <th field="IsDefaultAddress" width="80" align="center">
                    是否默认地址
                </th>
                <th field="CreateDateTime" formatter="Common.DateTimeFormatter" width="100" align="center">
                    创建时间
                </th>
                <th field="UpdateDateTime" formatter="Common.DateTimeFormatter" width="100" align="center">
                    创建时间
                </th>
            </tr>
        </thead>
    </table>
</div>
